package com.ljl.forum_1.exception;

import com.ljl.forum_1.common.AppResult;

/**
 * Keafmd
 *
 * @ClassName: ApplicationException
 * @Description: ApplicationException
 * @author: lijl
 * @date: 2025/1/25 20:50
 * @Blog: https://keafmd.blog.csdn.net/
 */

// 自定义异常
public class ApplicationException extends RuntimeException{
    // 在异常中持有一个错误信息对象
    protected AppResult errorResult;

    public AppResult getErrorResult() {
        return errorResult;
    }

    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }
}
